<!DOCTYPE html>
<html>
<head>
    <title>选房情况汇总表</title>
<#include "../../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header"><span class="jmdf-color-red jmdf-text-bold">【${(azProject.projectName)!}】</span>选房情况汇总表
        </div>
        <div class="layui-card-body">
            <button class="layui-btn layui-btn-bg" id="excelBtn"><i
                    class="layui-icon layui-icon-export"></i>导出Excel
            </button>
            <table class="layui-table table" style="text-align: center;">
                <tr class="layui-bg-gray">
                    <th style="text-align: center;" rowspan="3">序号</th>
                    <th style="text-align: center;" rowspan="3">征收项目名称</th>
                    <th style="text-align: center;" colspan="3">基础信息</th>
                    <th style="text-align: center;" colspan="11">选房情况</th>
                    <th style="text-align: center;" colspan="3">财务结算金额（元）</th>

                </tr>
                <tr class="layui-bg-gray">
                    <th style="text-align: center;" colspan="2">征迁安置情况</th>
                    <th style="text-align: center;" rowspan="2" width="6%">安置时段</th>
                    <th style="text-align: center;">小户型</th>
                    <th style="text-align: center;" colspan="5">普通型</th>
                    <th style="text-align: center;" colspan="2">房源合计</th>
                    <th style="text-align: center;" colspan="2">储物间</th>
                    <th style="text-align: center;" rowspan="2">车位数</th>
                    <th style="text-align: center;" rowspan="2">应发放金额(元)</th>
                    <th style="text-align: center;" rowspan="2">应缴款金额(元)</th>
                    <th style="text-align: center;" rowspan="2">合计(元)</th>
                </tr>
                <tr class="layui-bg-gray">
                    <th style="text-align: center;">户数</th>
                    <th style="text-align: center;">总安置面积（㎡）</th>
                    <th style="text-align: center;">一室(套)</th>
                    <th style="text-align: center;">一室二厅(套)</th>
                    <th style="text-align: center;">二室二厅(套)</th>
                    <th style="text-align: center;">三室二厅(套)</th>
                    <th style="text-align: center;">四室二厅(套)</th>
                    <th style="text-align: center;">合计(套)</th>
                    <th style="text-align: center;">数量(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">数量(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                </tr>
            <#assign index = 0/>
            <#assign allContractCountSum = 0/>
            <#assign allLimitHouseAreaSum = 0/>
            <#--未用-->
            <#assign allMoreCountSum = 0/>
            <#assign allMoreMoneySum = 0/>
            <#--未用-->
            <#assign allLessCountSum = 0/>
            <#assign allLessMoneySum = 0/>
            <#assign allFinalMoneySum = 0/>
            <#--未用-->
            <#assign allNormalHouseCountSum = 0/>
            <#--未用-->
            <#assign allNormalHouseAreaSum = 0/>
            <#--未用-->
            <#assign allSmallHouseCountSum = 0/>
            <#--未用-->
            <#assign allSmallHouseAreaSum = 0/>
            <#assign all0100HouseCountSum = 0/>
            <#--未用-->
            <#assign all0100HouseAreaSum = 0/>
            <#assign all0102HouseCountSum = 0/>
            <#--未用-->
            <#assign all0102HouseAreaSum = 0/>
            <#assign all0202HouseCountSum = 0/>
            <#--未用-->
            <#assign all0202HouseAreaSum = 0/>
            <#assign all0302HouseCountSum = 0/>
            <#--未用-->
            <#assign all0302HouseAreaSum = 0/>
            <#assign all0402HouseCountSum = 0/>
            <#--未用-->
            <#assign all0402HouseAreaSum = 0/>
            <#assign allHouseCountSum = 0/>
            <#assign allHouseAreaSum = 0/>

            <#assign allStorageRoomCountSum = 0/>
            <#assign allStorageRoomAreaSum = 0/>
            <#assign allCarLotCountSum = 0/>
            <#if zsProjectList?size !=0>
                <#list zsProjectList as zsProject>
                    <#assign contractCountMap = (contractMap[zsProject.id?c])!/>
                    <#assign houseCountMap = (houseMap[zsProject.id?c])!/>
                    <#assign storageRoomCountMap= (storageRoomMap[zsProject.id?c])!/>
                    <#assign carLotCountMap = (carLotMap[zsProject.id?c])! />
                    <#assign index = index+1 />

                    <#assign allContractCountSum = allContractCountSum + (contractCountMap['contractTotal'])!0/>
                    <#assign allLimitHouseAreaSum = allLimitHouseAreaSum + (contractCountMap['limitHouseAreaTotal'])!0/>
                <#--未用-->
                    <#assign allMoreCountSum = allMoreCountSum + (contractCountMap['moreCount'])!0/>
                    <#assign allMoreMoneySum = allMoreMoneySum + (contractCountMap['moreMoney'])!0/>
                <#--未用-->
                    <#assign allLessCountSum = allLessCountSum + (contractCountMap['lessCount'])!0/>
                    <#assign allLessMoneySum = allLessMoneySum + (contractCountMap['lessMoney'])!0/>
                    <#assign allFinalMoneySum = allFinalMoneySum + (contractCountMap['finalMoney'])!0/>

                    <#assign allNormalHouseCountSum = allNormalHouseCountSum + (houseCountMap['normalHouseNum'])!0/>
                <#--未用-->
                    <#assign allNormalHouseAreaSum = allNormalHouseAreaSum + (houseCountMap['normalHouseArea'])!0/>
                <#--未用-->
                    <#assign allSmallHouseCountSum = allSmallHouseCountSum + (houseCountMap['smallHouseNum'])!0/>
                <#--未用-->
                    <#assign allSmallHouseAreaSum = allSmallHouseAreaSum + (houseCountMap['smallHouseArea'])!0/>
                <#--未用-->

                    <#assign all0100HouseCountSum = all0100HouseCountSum + (houseCountMap['0100HouseNum'])!0/>
                    <#assign all0100HouseAreaSum = all0100HouseAreaSum + (houseCountMap['0100HouseArea'])!0/>
                    <#assign all0102HouseCountSum = all0102HouseCountSum + (houseCountMap['0102HouseNum'])!0/>
                    <#assign all0102HouseAreaSum = all0102HouseAreaSum + (houseCountMap['0102HouseArea'])!0/>
                    <#assign all0202HouseCountSum = all0202HouseCountSum + (houseCountMap['0202HouseNum'])!0/>
                    <#assign all0202HouseAreaSum = all0202HouseAreaSum + (houseCountMap['0202HouseArea'])!0/>
                    <#assign all0302HouseCountSum = all0302HouseCountSum + (houseCountMap['0302HouseNum'])!0/>
                    <#assign all0302HouseAreaSum = all0302HouseAreaSum + (houseCountMap['0302HouseArea'])!0/>
                    <#assign all0402HouseCountSum = all0402HouseCountSum + (houseCountMap['0402HouseNum'])!0/>
                    <#assign all0402HouseAreaSum = all0402HouseAreaSum + (houseCountMap['0402HouseArea'])!0/>

                    <#assign allHouseCountSum = allHouseCountSum + (houseCountMap['houseNum'])!0/>
                    <#assign allHouseAreaSum = allHouseAreaSum + (houseCountMap['houseArea'])!0/>
                    <#assign allStorageRoomCountSum = allStorageRoomCountSum + (storageRoomCountMap['storageRoomTotal'])!0/>
                    <#assign allStorageRoomAreaSum = allStorageRoomAreaSum + (storageRoomCountMap['storageRoomArea'])!0/>
                    <#assign allCarLotCountSum = allCarLotCountSum + (carLotCountMap['chooseCount'])!0/>
                    <tr>
                        <td>${(index)!0}</td>
                        <td>
                            <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}">${(zsProject.projectName)!}</a>
                        </td>
                        <td>
                            <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}">${(contractCountMap['contractTotal'])!0}
                        </td>
                        <td>
                            <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}">${(contractCountMap['limitHouseAreaTotal'])!0}
                        </td>
                        <td>${(contractCountMap['zsProjectDate']?string('yyyy年MM月'))!}年度</td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0100">${(houseCountMap['0100HouseNum'])!0}
                        </td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0102">${(houseCountMap['0102HouseNum'])!0}
                        </td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0202">${(houseCountMap['0202HouseNum'])!0}
                        </td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0302">${(houseCountMap['0302HouseNum'])!0}
                        </td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0402">${(houseCountMap['0402HouseNum'])!0}
                        </td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseType=01">${(houseCountMap['normalHouseNum'])!0}
                        </td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}">${(houseCountMap['houseNum'])!0}
                        </td>
                        <td>
                            <a href="houseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}">${(houseCountMap['houseArea'])!0}
                        </td>
                        <td>${(storageRoomCountMap['storageRoomTotal'])!0}</td>
                        <td>${(storageRoomCountMap['storageRoomArea'])!0}</td>
                        <td>${(carLotCountMap['chooseCount'])!0}</td>
                        <td>${(contractCountMap['moreMoney'])!0}</td>
                        <td>${(contractCountMap['lessMoney'])!0}</td>
                        <td>
                            <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}">${(contractCountMap['finalMoney'])!0}
                        </td>

                    </tr>
                </#list>
            </#if>
                <tr bgcolor="#b0c4de">
                    <td colspan="2">合计</td>
                    <td><a href="contractShow.ftl?azProjectId=${(azProject.id)!}">${allContractCountSum}</td>
                    <td><a href="contractShow.ftl?azProjectId=${(azProject.id)!}">${allLimitHouseAreaSum}</td>
                    <td></td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0100">${all0100HouseCountSum}</td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0102">${all0102HouseCountSum}</td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0202">${all0202HouseCountSum}</td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0302">${all0302HouseCountSum}</td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0402">${all0402HouseCountSum}</td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}&houseType=01">${allNormalHouseCountSum}</td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}">${allHouseCountSum}</td>
                    <td><a href="houseShow.ftl?azProjectId=${(azProject.id)!}">${allHouseAreaSum}</td>
                    <td>${allStorageRoomCountSum}</td>
                    <td>${allStorageRoomAreaSum}</td>
                    <td>${allCarLotCountSum}</td>
                    <td>${allMoreMoneySum}</td>
                    <td>${allLessMoneySum}</td>
                    <td><a href="contractShow.ftl?azProjectId=${(azProject.id)!}">${allFinalMoneySum}</td>
                </tr>
            </table>
        </div>
    </div>
</div>
<div class="footer">
    <button type="button" class="layui-btn layui-btn-green" id="backBtn">返　回</button>
</div>
</body>
</html>
<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/plugins/jquery/jquery.min.js" charset="utf-8"></script>
<script src="/plugins/tableExcel/jquery.table2excel.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['jquery'], function () {
        var $ = layui.jquery;

        $("#backBtn").click(function () {
            javascript:history.back(-1);
        });
    });
    $("#excelBtn").click(function () {
        $(".table").table2excel({
            exclude: ".noExl",
            name: "${(azProject.projectName)!}选房情况汇总表",
            filename: "${(azProject.projectName)!}选房情况汇总表",
            exclude_img: true,
            exclude_links: true,
            exclude_inputs: true
        });
    });
</script>